package observers

import futbol5.Post

class MailSender  {
	MessageSender messageSender

	new(MessageSender pMessageSender) {
		messageSender = pMessageSender
	}

	def void send(Post post){
		var destinatarios = post.generarDestinos()
		
		destinatarios.forEach[ j | 
		
		val mail = new Mail
		mail.to = j
		mail.message = post.mensaje
		messageSender.send(mail)
		]
	}
}